Skip to content

Conversation

koder95
Copy link

@koder95 koder95 commented Aug 31, 2025

No description provided.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

Decision: REQUEST_CHANGES — core requirements are missing and block task completion.

Critical issues to fix (blockers):

  1. Use abstract references as required: In src/main/java/core/basesyntax/MainApp.java, create a Machine[] (or a collection of Machine) that holds instances of Truck, Bulldozer, and Excavator. This is mandated by the checklist and task. Why: The assignment requires demonstrating polymorphism via an abstract reference.
  2. Implement the core loop in main(): Iterate over the Machine array and call doWork() and then stopWork() on each element. Currently, only a placeholder print is present, so the program does not demonstrate the required behavior.
  3. Formatting issues: Remove the redundant empty line after the class declaration and the empty line after the main method signature. This violates the checklist about avoiding redundant empty lines.

How to fix (hints):

  • In main(String[] args), instantiate Machine[] machines = new Machine[] { new Truck(), new Bulldozer(), new Excavator() }; then loop: for (Machine m : machines) { m.doWork(); m.stopWork(); }.
  • Ensure Truck, Bulldozer, and Excavator extend Machine, and Machine declares abstract methods doWork() and stopWork() with informative messages in subclasses.

You’ve got the structure in place—once you wire up the Machine hierarchy and the main loop, you’ll meet the core requirements. Keep going; you’re close!


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Important

Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.

Tip

If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.

Caution

Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.

Footnotes

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

private MainApp() {
}

public static void main(String[] args) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This violates checklist item: "Use abstract references instead of specific ones where possible" and the task requirement to instantiate an array (or collection) of Machine references containing Truck, Bulldozer, and Excavator instances. You must create such an array and use it in main().

}

public static void main(String[] args) {
System.out.println("Java is the best");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This violates the core functional requirement: In main(), you must iterate over the Machine array and call doWork() and stopWork() on each element. Currently, you only print a placeholder message.

package core.basesyntax;

public class MainApp {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This violates checklist item: "Please don't add redundant empty lines to your code." Remove the empty line after the class declaration.


private MainApp() {
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This violates checklist item: "Please don't add redundant empty lines to your code." Remove the empty line after the method signature.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

Decision: Approve. The core functionality, inheritance structure, and polymorphic behavior are correctly implemented and meet the task requirements.

Reasoning: While there are typos in the stopWork() messages across three classes, these are minor and do not break functionality. Still, they should be fixed to fully align with the checklist item about informative, correct English messages.

Issues to Address (non-blocking, but please fix):

  • Typo in stopWork() messages:
    • src/main/java/core/basesyntax/Bulldozer.java – In stopWork(), change "Bulldozer stoped working" to "Bulldozer stopped working". (Look near the System.out.println(...) call, likely around the single print line in this method.)
    • src/main/java/core/basesyntax/Excavator.java – In stopWork(), change "Excavator stoped working" to "Excavator stopped working".
    • src/main/java/core/basesyntax/Truck.java – In stopWork(), change "Truck stoped working" to "Truck stopped working".

Why this matters: The checklist requires clear, correct English in user-facing messages. Correcting the spelling keeps your output professional and unambiguous.

Great job on the class hierarchy and the MainApp polymorphism demo. Update the typos and you’ll be in perfect shape!


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Footnotes

  1. Rate AI review example

}

public void stopWork() {
System.out.println("Bulldozer stoped working");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a typo in the output message: "Bulldozer stoped working" should be "Bulldozer stopped working". This violates checklist item: "Write informative messages in methods" (messages must be in correct English).

}

public void stopWork() {
System.out.println("Excavator stoped working");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a typo in the output message: "Excavator stoped working" should be "Excavator stopped working". This violates checklist item: "Write informative messages in methods" (messages must be in correct English).

}

public void stopWork() {
System.out.println("Truck stoped working");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a typo in the output message: "Truck stoped working" should be "Truck stopped working". This violates checklist item: "Write informative messages in methods" (messages must be in correct English).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants